package org.apache.ocean.udp;

import org.apache.ocean.XMLUtil;
import org.jdom.Element;

/**
 *
 * @author jasonr
 */
public class Announcement {
  public String host;
  public Integer port;

  public Announcement(Element element) {
    host = element.getChildText("host");
    port = XMLUtil.getChildInteger("port", element);
  }
  
  public Element toElement() {
    Element element = new Element("announcement");
    XMLUtil.createTextElement("host", host, element);
    XMLUtil.createTextElement("port", port, element);
    return element;
  }
}
